package com.javait.day8;

import java.util.Scanner;

public class TextScanner {
    public static void main(String[] args) {
        String a="admin";
        String password="1610295447";
        Scanner s = new Scanner(System.in);
        for (int i = 1; i <=3 ; i++) {
            System.out.println("请输入用户名:");
            String admin=s.next();
            System.out.println("请输入密码:");
            String pass=s.next();
            if (a.equals(admin)&&password.equals(pass)){
                System.out.println("登陆成功!");
                break;
            }else{
                if (i==3){
                    System.out.println("今日次数已用完");
                }else{
                    System.out.println("登陆失败,还剩"+(3-i)+"次机会");
                }
            }
        }

    }
}
